package ch.nortgram.countdown_worldcup_2014.rss;
import java.util.ArrayList;

import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;

public class Feed implements Parcelable
	{
	private String title;
	private String link;
	private String description;
	private String language;
	private ArrayList<Item> Items;

	public Feed()
		{
		Items = new ArrayList<Item>();
		}

	public Feed(Parcel source)
		{
		Bundle data = source.readBundle();
		title = data.getString("title");
		link = data.getString("link");
		description = data.getString("description");
		language = data.getString("language");
		Items = data.getParcelableArrayList("Items");
		}

	@Override
	public void writeToParcel(Parcel dest, int flags)
		{
		Bundle data = new Bundle();
		data.putString("title", title);
		data.putString("link", link);
		data.putString("description", description);
		data.putString("language", language);
		data.putParcelableArrayList("Items", Items);
		dest.writeBundle(data);
		}

	public static final Parcelable.Creator<Feed> CREATOR = new Parcelable.Creator<Feed>()
		{
		public Feed createFromParcel(Parcel data)
			{
			return new Feed(data);
			}
		public Feed[] newArray(int size)
			{
			return new Feed[size];
			}
		};

	@Override
	public int describeContents()
		{
		return 0;
		}

	void addItem(Item Item)
		{
		Items.add(Item);
		}

	public String getTitle()
		{
		return title;
		}

	public void setTitle(String title) 
		{
		this.title = title;
		}

	public String getLink() 
		{
		return link;
		}

	public void setLink(String link) 
		{
		this.link = link;
		}

	public String getDescription() 
		{
		return description;
		}

	public void setDescription(String description) 
		{
		this.description = description;
		}

	public String getLanguage()
		{
		return language;
		}

	public void setLanguage(String language)
		{
		this.language = language;
		}

	public ArrayList<Item> getItems() 
		{
		return Items;
		}

	public void setItems(ArrayList<Item> Items)
		{
		this.Items = Items;
		} 
}